package com.android.clinic.app.ui.widget.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.android.clinic.app.R;

/**
 * Created by cheng on 2018/2/9.
 */
public class LoadingDialog extends Dialog {

    private Context mContext;
    private TextView mTitle;

    public LoadingDialog(@NonNull Context context) {
        super(context, R.style.custom_dialog);
        this.mContext = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        View convertView = LayoutInflater.from(mContext).inflate(R.layout.dialog_loading_layout, null);
        mTitle = (TextView) convertView.findViewById(R.id.tv_title);
        setContentView(convertView);
    }

    public void setTitle(String title) {
        mTitle.setText(!TextUtils.isEmpty(title) ? title : "提交中...");
    }

}
